<?php
    $title = $_POST['title'];
    $category = $_POST['category'];
    $description = $_POST['description'];
    $source = $_POST['source'];

    if (empty($title) || empty($category) || empty($description) || empty($source)) {
        $errMsg =  "Все поля формы должны быть заполнены !";
    } else {
        $save_news = $news->saveNews($news->clearStr($title),
            $news->clearInt($category),
            $news->clearStr($description),
            $news->clearStr($source));

        if (!$save_news) {
            $errMsg = "Ошибка добавления новости !";
        }

        header("Location: ".$_SERVER['PHP_SELF']);
    }
?>